package PageLib;

public class allPhones extends PageOpn {

	public boolean pageElements(String element,String exp)
	{
	System.out.println("dd");
		return(true);
	}
public void assignToVariable( String identifier,String element)
{
	browserObj.assignId( element,identifier);
	
	

}
	
	public boolean addToCart(String element)
	{
		//if the element is present before adding phone and plan to cart then the test is
		//failed
		/*String addcartPl;
		String phone="";
		String addcartP=;
		String plan="";*/
		
	//	assignToVariable("link=Phones",phone);
		//assignToVariable("//*[@id='ctl00_ctl00_ctl00_ContentPlaceHolderPageTile_ContentPlaceHolderMainContentWrapper_ContentPlaceHolderMainContentWrapper_ListView1_ctrl1_btnAddToCart']",addcartP);
		
		
		if(verifyElement(element))
		{
			System.out.println("failed test..element is present before adding phone");
		}
		else 
		{
			  clickLink("link=shop phones");//on phone
			  clickLink("//a[contains(text(),'Add to Cart')]");// on addcart
			  enterText("document.forms[0].elements[5]","94086");
			  clickLink("document.forms[0].elements[5]");
			  if(verifyElement(element))
			    {
				System.out.println("element is present before adding plan");
			     }
				else
				   {
					clickLink("plan");//on plan	
				
				    clickLink("addcartPl");//on add to cart
			        if(verifyElement(element))
					      {
				System.out.println("element passed");
				return(verifyElement(element));
					       }
				    }
		}//end of else1
			  return(true);
		}// end of addtocart
		
		
		
	
}//end of class
